﻿Imports System.Net.Sockets

Public Class StateObject
    ' Client  socket.
    Public workSocket As Socket = Nothing
    ' Size of receive buffer.
    Public Const BufferSize As Integer = 1024
    ' Receive buffer.
    Public buffer(BufferSize) As Byte

    Property UserName As String

    Property IsAdmin As Boolean

    Property Messages As New List(Of Message)
End Class 'StateObject

Public Class Message
    Property SentAt As DateTime
    Property Content As String
    Sub New()
        Me.SentAt = Now
    End Sub
    Sub New(ByVal dt As Date)
        Me.SentAt = dt
    End Sub
End Class